package Tests;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import ChampionFactory.AbstractChampionFactory;

public class ChampionFactoryTest
{

	@BeforeClass
	public static void setUpBeforeClass() throws Exception
	{
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception
	{
	}

	@Before
	public void setUp() throws Exception
	{
	}

	@After
	public void tearDown() throws Exception
	{
	}

	/**
	 * Checks that a Champion is returned in any cases - Also indirectly checks
	 * that the random number is always in 0-2 range
	 */
	@Test
	public void testChampionIsNotNull()
	{
		for (int i = 0; i < 1000; i++)
			assertNotNull(AbstractChampionFactory.getChampion());
	}
	
	
	/**
	 * Checks that Champion fields is correctly filled
	 */
	@Test
	public void testChampionFields()
	{
		assertNotNull(AbstractChampionFactory.getChampion()
				.getDegatsMagiques());
		assertNotNull(AbstractChampionFactory.getChampion()
				.getDegatsPhysiques());
		assertNotNull(AbstractChampionFactory.getChampion()
				.getDeplacement());
		assertNotNull(AbstractChampionFactory.getChampion().getPtsDeVie());
	}

}
